Problem: The function $f(x),$ defined for $0 \le x \le 1,$ has the following properties:

(i) $f(0) = 0.$
(ii) If $0 \le x < y \le 1,$ then $f(x) \le f(y).$
(iii) $f(1 - x) = 1 - f(x)$ for all $0 \le x \le 1.$
(iv) $f \left( \frac{x}{3} \right) = \frac{f(x)}{2}$ for $0 \le x \le 1.$

Find $f \left( \frac{2}{7} \right).$
Answer: We know that $f(0) = 0,$ so from property (iii),
\[f(1) = 1 - f(0) = 1.\]Then from property (iv),
\[f \left( \frac{1}{3} \right) = \frac{f(1)}{2} = \frac{1}{2}.\]Then from property (iii),
\[f \left( \frac{2}{3} \right) = 1 - f \left( \frac{1}{3} \right) = 1 - \frac{1}{2} = \frac{1}{2}.\]Property (ii) states that the function is non-decreasing.  Since $f \left( \frac{1}{3} \right) = f \left( \frac{2}{3} \right) = \frac{1}{2},$ we can say that $f(x) = \frac{1}{2}$ for all $\frac{1}{3} \le x \le \frac{2}{3}.$  In particular, $f \left( \frac{3}{7} \right) = \frac{1}{2}.$

Then by property (iv),
\[f \left( \frac{1}{7} \right) = \frac{f(\frac{3}{7})}{2} = \frac{1}{4}.\]By property (iii),
\[f \left( \frac{6}{7} \right) = 1 - f \left( \frac{1}{7} \right) = 1 - \frac{1}{4} = \frac{3}{4}.\]Finally, by property (iv),
\[f \left( \frac{2}{7} \right) = \frac{f(\frac{6}{7})}{2} = \boxed{\frac{3}{8}}.\]The properties listed in the problem uniquely determine the function $f(x).$  Its graph is shown below:

[asy]
unitsize (5 cm);

path[] cantor;
int n;

cantor[0] = (1/3,1/2)--(2/3,1/2);

for (n = 1; n <= 10; ++n) {
  cantor[n] = yscale(1/2)*xscale(1/3)*(cantor[n - 1])--cantor[0]--shift((2/3,1/2))*yscale(1/2)*xscale(1/3)*(cantor[n - 1]);
}

draw(cantor[10],red);
draw((0,0)--(1,0));
draw((0,0)--(0,1));
[/asy]

For reference, the function $f(x)$ is called the Cantor function.  It is also known as the Devil's Staircase.